import java.util.ArrayList;

public class ArraysLis {

    public static void main(String[] args) {
        ArrayList<String> a = new ArrayList<String>();
        a.add("战争践踏");
        System.out.println(a);
        a.add("口水攻击");
        a.add("多远都要在一起");
        System.out.println(a);
        a.add(1,"jihe");
        System.out.println(a);
        System.out.println(a.get(3));
        System.out.println(a.get(1));
        System.out.println(a.size());

        System.out.println(a.remove(2));
        System.out.println(a);
        System.out.println(a.remove(2));
        System.out.println(a);
        System.out.println(a.remove("战争践踏"));
        System.out.println(a);

        System.out.println(a.remove("jihe"));
        System.out.println(a);
        System.out.println(a.add("元素"));
        System.out.println(a.add("指定"));
        System.out.println(a.add("索引"));
        System.out.println(a.add("位置"));
        System.out.println(a.set(2, "添加"));
        System.out.println(a);
        System.out.println(a.set(3, "返回"));
        System.out.println(a);
    }
}
